﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class _课堂练习3自定义验证 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
        {
            string txt = args.Value;//用户输入
            if(txt == "zfq888"||txt == "wsx888")
            {
                args.IsValid = false;

            }
            else
            {
                args.IsValid = true;
            }
        }
    }
}